% Refer to:
% https://tex.stackexchange.com/questions/547547/use-jetbrains-mono-ligatures-with-fontspec-and-lstlisting-environment 
\documentclass{article}
\usepackage{fontspec}
\usepackage{xcolor}
\setmonofont{JetBrains Mono}[
    Contextuals = Alternate,
    Ligatures = TeX,
]

\usepackage{listings}
\lstset{
    basicstyle = \ttfamily,
    columns = flexible,
}
\makeatletter
\renewcommand*\verbatim@nolig@list{}
\makeatother
\begin{document}

    \begin{lstlisting}[language = C++, numbers=left,
        numberstyle=\tiny,keywordstyle=\color{blue!70},
        commentstyle=\color{red!50!green!50!blue!50},frame=shadowbox,
        rulesepcolor=\color{red!20!green!20!blue!20},basicstyle=\ttfamily]
        void work();
        std::thread my_thread(work);
    \end{lstlisting}

\end{document}
